#coding=utf-8
'''
Created on 2010-9-19
@author: lxd
'''
import sys
sys.path.append('.')
sys.path.append('..')
import wx
import panelLogin,panelRegister,panelEncard,panelModify,panelQuery
import config
    
class MainFrame(wx.Frame):
    def __init__(self, log,**kargs):
        wx.Frame.__init__(self, None, -1, config.application_name, size=(300, 250))
        self.nb = wx.Notebook(self)
                     
        self.loginPage = panelLogin.MainPanel(self.nb, log, **kargs)
        self.registerPage = panelRegister.MainPanel(self.nb, log, **kargs)
        self.encardPage = panelEncard.MainPanel(self.nb, log, **kargs)
        self.modifyPage = panelModify.MainPanel(self.nb, log, **kargs)
        self.queryPage = panelQuery.MainPanel(self.nb, log, **kargs)
        
        self.nb.AddPage(self.loginPage, u'登陆')
        self.nb.AddPage(self.registerPage, u'注册')
        self.nb.AddPage(self.encardPage, u'充值')
        self.nb.AddPage(self.modifyPage, u'修改')
        self.nb.AddPage(self.queryPage, u'查询')
        
        self.Center()    
        self.layout()

    def layout(self):
        mainSizer = wx.BoxSizer(wx.VERTICAL)
        mainSizer.Add(self.nb, 1, wx.ALL | wx.EXPAND, 5)
        self.SetSizer(mainSizer)
        
if __name__ == '__main__':
    import config
    app = wx.PySimpleApp()
    main = MainFrame(config.log)
    main.Show()
    app.MainLoop()
